
from fastapi import APIRouter, HTTPException, Depends

from typing_extensions import Any

from common.sqlalchemy_db import SqlalchemyX
from service.DialogService import DialogService

router = APIRouter()


dialog_service = DialogService()



# 注册 /dialog-list 路由
@router.get("/dialog-list")
async def get_dialog_list_route(
        userId: str,
        page: int,
        limit: int):
    result = await dialog_service.get_dialog_list_by_user_id( userId, page, limit)
    return result

@router.get("/dialog")
async def get_dialog_route(
        dialogFromId: str,
        dialogTargetId: str):
    result = await dialog_service.check_and_get_dialog_mes({"dialog_from_id":dialogFromId,"dialog_target_id":dialogTargetId})
    return result
